import logging

from utils.date_tuils import get_day_start_time, get_day_end_time

logging.basicConfig(
    level=logging.INFO,
    format='%(asctime)s - %(levelname)s - %(message)s'
)
logger = logging.getLogger(__name__)

def get_range_time():
    from config.config import CONFIG
    offset_start_day = CONFIG.get('sync')['sync_start_time']
    offset_end_day =  CONFIG.get('sync')['sync_end_time']
    logger.info('指定的日期: %s %s', offset_start_day, offset_end_day)
    start, end = get_day_start_time(offset_start_day), get_day_end_time(offset_end_day)
    logger.info('时间区间: %s 到 %s', start, end)
    return start, end


def delete_tag():
    from config.config import CONFIG
    return CONFIG.get('sync')['delete_dev_tag']


def sync_tag():
    from config.config import CONFIG
    return CONFIG.get('sync')['sync_prod_tag']
